package com.ts.conch.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ts.conch.entity.TsAdminRoleRelation;
import com.ts.conch.entity.TsPermission;
import com.ts.conch.entity.TsRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ItsAdminRoleRelationDao extends BaseMapper<TsAdminRoleRelation> {

    /**
     * @return java.util.List<java.util.Map>
     * @method getPermissionList
     * create by: IDai
     * description: 获取用户所有权限(包括+-权限)
     * create time: 2020-07-06 13:38
     * @Param: [adminId]
     */
    List<TsPermission> getPermissionList(Long adminId);

    /**
     * @return java.util.List<com.lr.iboot.api.entity.LrResource>
     * @method getResourceList
     * create by: IDai
     * description: 获取用户所有可访问资源
     * create time: 2020-08-14 10:37
     * @Param: [adminId]
     */
    List<TsPermission> getPermissionListByAdminId(@Param("adminId") String adminId);


    /**
     * @return int
     * @method insertList
     * create by: IDai
     * description: 批量插入用户角色关系
     * create time: 2020-08-19 9:55
     * @Param: [adminRoleRelationList]
     */
    int insertList(@Param("list") List<TsAdminRoleRelation> adminRoleRelationList);

    /**
     * @return java.util.List<com.lr.iboot.api.entity.LrRole>
     * @method getRoleList
     * create by: IDai
     * description: 获取用户所有角色
     * create time: 2020-08-19 9:55
     * @Param: [adminId]
     */
    List<TsRole> getRoleList(@Param("adminId") String adminId);

    /**
     * @return java.util.List<java.lang.Long>
     * @method getAdminIdList
     * create by: IDai
     * description: 获取资源相关用户ID列表
     * create time: 2020-08-19 9:55
     * @Param: [resourceId]
     */
    List<Long> getAdminIdList(@Param("permissionId") String permissionId);

    int deleteByPrimaryKey(Long id);

    int insert(TsAdminRoleRelation record);

    int insertSelective(TsAdminRoleRelation record);

    TsAdminRoleRelation selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(TsAdminRoleRelation record);

    int updateByPrimaryKey(TsAdminRoleRelation record);

}